package com.googlecode.simplexer;

import com.googlecode.simplexer.io.*;
import com.googlecode.simplexer.validator.Validator;

public interface MappedLexer extends Lexer {

	/**
	 * Write the next token to mapped stream then return it.
	 * 
	 * @param dump whether to write the tokent to the mapped stream
	 * @param chr the expected char
	 * @return the next char
	 * @throws UnsupportedOperationException
	 */
	public String nextchar(boolean dump, char chr)
			throws UnsupportedOperationException;

	/**
	 * Write the next token to the mapped stream then return it.
	 * 
	 * @param dump whether to write the token to the mapped stream
	 * @return the next token
	 * @throws UnsupportedOperationException
	 */
	public String nexttok(boolean dump) throws UnsupportedOperationException;


	/**
	 * Write the next token to mapped stream then return it.
	 * 
	 * @param dump whether to write the tokent to the mapped stream
	 * @param tokens the expected tokens
	 * @return the next token
	 * @throws UnsupportedOperationException
	 */
	public String nexttok(boolean dump, String... tokens)
			throws UnsupportedOperationException;

	/**
	 * Write the next token to mapped stream then return it.
	 * 
	 * @param dump whether to write the tokent to the mapped stream
	 * @param tokens the expected tokens
	 * @return the next token
	 * @throws UnsupportedOperationException
	 */
	public String nexttok(boolean dump, Validator... verifiers)
			throws UnsupportedOperationException;

	public MappedLexer print(String message)
			throws UnsupportedOperationException;

	public void setDump(boolean dump) throws UnsupportedOperationException;

	public void setCharOutputSequence(CharOutputSequence ss)
			throws UnsupportedOperationException;
	
	public CharOutputSequence getCharOutputSequence();
	
	public CharInputSequence getCharInputSequence();

	public String skip(boolean dump, char chr)
			throws UnsupportedOperationException;

}
